added part count validation for download request#6353
Conversation
L-Applin
left a comment
There was a problem hiding this comment.
Can we add some tests cases for this new validation?
|
I think we need a test with an actual multipart s3AsyncClient, ie: We can still mock the http client but that might be a hard test to mock, let me think about it to see if there is a way to do it. |
|
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
| aResponse() | ||
| .withHeader("x-amz-mp-parts-count", totalPart + "") | ||
| .withHeader("ETag", eTag) | ||
| .withHeader("Content-Length", String.valueOf(body.length)) |
There was a problem hiding this comment.
Just curious, why are we making this change?
There was a problem hiding this comment.
I used this change to do some testing, but that testing is deleted. Figured this change makes the response more "real" so I kept it
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
Motivation and Context
For the part get request for S3 transfer manager, When a response is received, the S3 Transfer Manager MUST check the value of ContentRange and validate that it matches with the expected range for the specific part number. After all requests have been sent, we should validate that the total number of part GET requests sent matches with the expected PartsCount. This PR implements the validation.
Modifications
Added validation method in MultipartDownloaderSubscriber class
Testing
Added wiremock test for failed test
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License